import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { knowledge } from '../apiModulesType';

// 后台查询模板文件
export function apiadminQueryTemplate(query: any): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/adminQueryTemplate`,
    method: 'get',
    params: query
  });
}

//删除模板通过模板id
export function apideleteTemplateById(query: any): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/deleteTemplateById`,
    method: 'get',
    params: query
  });
}

// 更新模板信息
export function apiupdateTemplate(data: any): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/updateTemplate`,
    method: 'post',
    data: data
  });
}

// 新增模板
export function apicreateTemplate(data: any): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/createTemplate`,
    method: 'post',
    data: data
  });
}

// 批量新增模板
export function apibatchUpload(data: any): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/batchUpload`,
    method: 'post',
    data: data
  });
}

//删除所有模板文件
export function deleteAllTemplate(): AxiosPromise<any> {
  return request({
    url: `${knowledge}/api/templateTree/deleteAllTemplate`,
    method: 'post',
  });
}
